// 实现 Iterable 接口就是for...of的前提
const arr = [100, 200, 400, 300];

for (const item of arr) {
  console.log(item);
  if (item > 100) {
    break;
  }
}

const s = new Set(["foo", "bar"]);
for (const item of s) {
  console.log(item);
}

const m = new Map();
m.set("foo", "123");
m.set("bar", "456");
for (const [key, value] of m) {
  console.log("🚀 ~ key, value:", key, value);
}

const obj = { foo: "123", bar: "456" };
for (const item of obj) {
  console.log(item);
}
